<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--       
*     Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
*     Use is subject to license terms.
-->
<html>
<head>
	<title>Generating a UI Stub File for a JavaFX Graphic</title>
<link href="nbdocs:/org/netbeans/modules/usersguide/ide.css"  rel="stylesheet" type="text/css">
</head>
<body>
<h2>Generating a UI Stub File for a JavaFX Graphic</h2>
<p> <small><a href="#seealso">See Also</a>&nbsp; </small> 


<p>When a JavaFX graphic in FXZ format is included in a NetBeans project,  developers can use it to generate a UI Stub file. A UI stub file is a  shortcut for loading the graphic in the JavaFX application. A UI stub  file extends <code>FXDNode</code>, loads the graphic, and declares a  variable for each graphic object that has an ID value. You can then  simply refer to the generated class and variables in your JavaFX  application, because the graphic is loaded in the UI stub.</p>
<p>The UI stub file that is generated has the same name as the JavaFX graphic plus a <code>UI</code> suffix. For example, if the JavaFX graphic is named <code>mediaplayer.fxz</code>, the stub file is named <code>mediaplayerUI.fx</code>. The class that is generated also has the name <code>mediaplayerUI</code>.</p>
<p>You do not need  to generate a UI Stub file to use an FXZ graphic in a JavaFX application. You can load JavaFX graphics in several ways. For examples of loading graphic in JavaFX  applications,  see the how-to topic <a href="http://javafx.com/docs/howto/Graphics-Tutorial.jsp#loadpsgraphics">How do I load Production Suite graphics?</a></p>
<h3><b>Prerequisites</b></h3>
<ul>
  <li>Before performing this procedure, you must add the JavaFX graphic to a NetBeans project. Be sure to identify the JavaFX graphic with an FXZ or FXD extension. </li>
</ul>

<h3><b>Procedure</b></h3>
<ol>
  <li>In the NetBeans IDE, open the project for your JavaFX application. </li>
  <li>Locate the FXZ file in the Projects window. </li>
  <li>Right-click (or Control-click on the Mac) the FXZ  file and select <code>Generate UI stub</code>. <br>
    The file is generated and appears in the Projects window.
  </li>
</ol>


<dl>
<dt><a name="seealso">See Also</a></dt>
<dd><a href="viewing_fxz_files.html">Viewing the JavaFX Graphics</a></dd> 
</dl>

<hr>
<p><font size=-2><a href="../credits.html">Legal Notices</a></font>
</p>
<table cellpadding="50" border="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

</body>
</html>
